<template>
  <div>
    <Button type="primary" size="small" :disabled="stats" @click="print">打印</Button>
  </div>
</template>

<script>
  import libs from "../libs/uploads";
  export default {
    name: 'PrintButton',
    props: {
      Url: null,
      Project_id: null,
      Atype: null,
      stats: {
        default: false
      }
    },
    data() {
      return {
        // stats: true
      }
    },
    // created() {
    //   if (this.Project_id != null&&this.stats=='') {
    //     this.stats = false
    //   }
    // },
    methods: {
      print() {
        let baseUrl = libs.uploads2();
        if(this.Atype != null){
          window.open(baseUrl + this.Url + "?ProjectId=" + this.Project_id + '&Atype=' + this.Atype, 'newwindow');
        }else{
           window.open(baseUrl + this.Url + "?ProjectId=" + this.Project_id , 'newwindow');
        }
      }
    }
  }
</script>

<style scoped>

</style>